<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 后台接口域名路由 adminapi
use think\Route;

Route::domain('adminapi', function () {
    // 后台接口模块首页路由
    Route::get('/', 'adminapi/index/index');

    // 验证码接口
    Route::get('captcha/:id', "\\think\\captcha\\CaptchaController@index");//访问图片需要
    Route::get('captcha', 'adminapi/login/captcha');

    //登录接口
    Route::post('login', 'adminapi/login/login');

    //退出接口
    Route::get('logout', 'adminapi/login/logout');

    //权限相关接口
    Route::resource('auths', 'adminapi/auth', [], ['id' => '\d+']);

    //获取菜单权限接口
    Route::get('nav', 'adminapi/auth/nav');

    //角色相关接口
    Route::resource('roles', 'adminapi/role', [], ['id' => '\d+']);

    //管理员相关接口
    Route::resource('admins', 'adminapi/admin', [], ['id' => '\d+']);
});
